package com.itheima.demo05;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

import static java.util.concurrent.Executors.newCachedThreadPool;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/13 19:21
 */
public class Demo_005 {
    public static void main(String[] args) {
        /*ExecutorService newCachedThreadPool() */
        //创建线程池对象 ;
        ExecutorService executorService = Executors.newCachedThreadPool();

        executorService.submit(()->{
            System.out.println(Thread.currentThread().getName()+"执行了");
        });

        executorService.submit(()->{
            System.out.println(Thread.currentThread().getName()+"执行了");
        });

        executorService.shutdown();
    }
}
